package pers.cz.connect;

/**
 * @program: postgirl-collection-client
 * @description: 抽象连接
 * @author: Cheng Zhi
 * @create: 2022-07-31 13:47
 **/
public abstract class Connection implements IConnection {

    public abstract void close();

    public abstract void realInsert(String context);

    public abstract void realSet(String key, String value);

    public abstract void realInsert(String key, String context);

    @Override
    public void insert(String context) {
        realInsert(context);
        close();
    }

    @Override
    public void insert(String key, String context) {
        realInsert(key, context);
        close();
    }

    @Override
    public void set(String key, String value) {
        realSet(key, value);
        close();
    }


}
